@<template>
  <div class='wiapper' ref='wiapper' >
      <div class="content" >
          <slot></slot>
      </div>
  </div>
</template>

<script>
import BScroll from 'better-scroll'
export default {
    props:{
        probeType: {
            type: Number,
            default: 0
        },
        pullUpLoad : {
            type: Boolean,
            default: false,
        },
        tabContrObj: {
            type: Object,
            default(){
                return {}
            }
        }
    },
    
    
    mounted(){
        this.scroll = new BScroll(this.$refs.wiapper, {
            probeType: this.probeType,//是否开启侦测

            //开启上拉加载
            pullUpLoad: this.pullUpLoad,

            click: true,//开启div监听点击时间
        })

     

        //监听滚动事件
        this.scroll.on('scroll', (position) => {
            this.$emit('showBack', position)
        })
       
        
        //监听上拉加载事件
        this.scroll.on('pullingUp', () => {
            this.$emit('isEnd',this.scroll)
        })
        
    },
    methods: {
        refresh() {
            this.scroll&&this.scroll.refresh();
        }
    }
}
</script>

<style>


</style>